package 乘积最大;

import java.util.Scanner;

public class Main {
    static int n, k;
    static String nums;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        k = in.nextInt();
        nums = in.next();
        System.out.println(dfs(0, 0, 0, 1));
    }

    private static long dfs(int u, int s, long p, long val) {
        if (s > k + 1) {
            return -1;
        }
        if (u == n) {
            if (s == k + 1) {
                return val;
            }
            return -1;
        }
        long num = p * 10 + nums.charAt(u) - '0';
        return Math.max(dfs(u + 1, s, num, val),
                dfs(u + 1, s + 1, 0, val * num));
    }
}
